﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="buyerFixedPricePeriodList.aspx.cs"
    Inherits="PeisongWeb.admin.buyerFixedPricePeriodList" %>

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>采购商固定价格周期列表 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sm1" runat="server">
    </asp:ScriptManager>
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            采购商固定价格周期列表
        </h2>
        <span style="<%=power>=2?"": "display:none" %>">
            <ext:Button runat="server" ID="Button1" Icon="Add" Text="设置固定价格" OnClientClick="window.location.href='buyerFixedPricePeriodEdit.aspx'">
            </ext:Button>
        </span>
        <p>
            &nbsp;</p>
        <ext:Panel ID="Panel1" runat="server" Title="搜索条件" BodyStyle="padding:5px 5px 0"
            Width="1120px" Frame="true" ButtonAlign="Center">
            <Body>
                <div id="admin_edit_content_search">
                    <ul>
                        <li style="width: auto; margin-right: 20px">
                            <label style="width: auto">
                                采购企业名称
                            </label>
                            <asp:TextBox runat="server" ID="txt_buyerName" Width="200px"></asp:TextBox>
                        </li>
                        <li style="width: auto; padding-right: 150px">
                            <label>
                                &nbsp;</label>
                            [<asp:LinkButton ID="lbtn_Search" runat="server" Text="搜 索" OnClick="lbtn_Search_Click"
                                CausesValidation="false"></asp:LinkButton>]&nbsp;&nbsp;&nbsp; [<a href="javascript:resetFactor();">重
                                    置</a>] </li>
                    </ul>
                </div>
            </Body>
        </ext:Panel>
        <p>
            &nbsp;</p>
        <div id="admin_list_content" style="width: 1120px">
            <table cellpadding="0" cellspacing="0">
                <tr class="header-row">
                    <th>
                        采购企业名称
                    </th>
                    <th>
                        开始收货日期
                    </th>
                    <th>
                        结束收货日期
                    </th>
                    <th>
                        创建日期
                    </th>
                    <th>
                        创建人
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                    <ItemTemplate>
                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                            <td width="20%" height="26">
                                <%# Eval("buyerName")%>
                            </td>
                            <td width="12%" height="10">
                                <%# Eval("startTime")%>
                            </td>
                            <td width="12%" height="26">
                                <%# Eval("endTime")%>
                            </td>
                            <td width="12%" height="10">
                                <%# Eval("inputDt")%>
                            </td>
                            <td width="10%" height="10">
                                <%# Eval("inputName")%>
                            </td>
                            <td width="7%" height="26" align="center">
                                <asp:LinkButton CausesValidation="false" ID="lbn_details" runat="server" CommandName="details"
                                    CommandArgument='<%# Eval("fpid") %>' Text="查看详情"></asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <div id="page">
                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                    OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                    LastPageText="末页" PrevPageText="上一页">
                </webdiyer:AspNetPager>
            </div>
        </div>
        <ext:Window ID="bfp_details" runat="server" Title="采购商固定价格周期详情" Height="630px" Width="1124px"
            BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
            Resizable="false" ShowOnLoad="false" Draggable="true" Icon="ApplicationViewDetail">
            <Body>
                <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
                    <Triggers>
                        <asp:PostBackTrigger ControlID="lbn_Add" />
                        <asp:PostBackTrigger ControlID="btn_Save" />
                        <asp:PostBackTrigger ControlID="link_Export_Detail" />
                    </Triggers>
                    <ContentTemplate>
                        <div class="details">
                            <h2>
                                <asp:Label runat="server" ID="lbl_buyerName"></asp:Label>
                                <input id="hd_buyerId" runat="server" type="hidden" />
                                <input id="hd_fpid" runat="server" type="hidden" />
                            </h2>
                            <hr />
                            <div id="div_AddProduct" style="width: 630px; display: none">
                                新添加商品信息 <span id="span_selectPros">
                                    <table width="98%">
                                        <tr align="center" style="height: 20px;">
                                            <td width="5%" bgcolor="#C0D5F0">
                                                序号
                                            </td>
                                            <td width="25%" bgcolor="#C0D5F0">
                                                商品名称
                                            </td>
                                            <td width="10%" bgcolor="#C0D5F0">
                                                供应价
                                            </td>
                                            <td width="10%" bgcolor="#C0D5F0">
                                                客户购买价
                                            </td>
                                            <td width="25%" bgcolor="#C0D5F0">
                                                供应商
                                            </td>
                                            <td width="15%" bgcolor="#C0D5F0">
                                                删除
                                            </td>
                                        </tr>
                                        <tbody id="tableBody">
                                        </tbody>
                                        <tr align="center" style="height: 20px;">
                                            <td bgcolor="#C0D5F0">
                                                <a href="javascript:void(0)" onclick="updateTableRowByUpdate();">刷新</a>
                                            </td>
                                        </tr>
                                    </table>
                                </span>
                            </div>
                            <table width="630px" border="0" cellpadding="4" cellspacing="1" style="text-align: left">
                                <tr style="<%=power>=2?"": "display:none" %>">
                                    <td style="width:420px">
                                        <input id="hd_proScope" runat="server" value="" type="hidden" />
                                        <asp:LinkButton ID="lbn_Add" runat="server" Text="【新增采购商固定价格商品】" OnClick="lbn_Add_Click"
                                            CausesValidation="false">
                                        </asp:LinkButton>
                                        <span id="val_proScope" style="color: Red; display: none; margin-left: 20px">未选择商品，不能提交订单，请选择商品！</span>
                                    </td>
                                    <td style="width:210px">
                                        <asp:Button runat="server" ID="btn_Save" Text="保　存" OnClick="btn_Save_Click" OnClientClick="return checkProductsByUpdate();" />
                                    </td>
                                </tr>
                            </table>
                            <%-- <div style="width: 630px">
                                <input id="hd_proScope" runat="server" value="" type="hidden" />
                                <span style="<%=power>=2?"": "display:none" %>;width:420px">
                                    <asp:LinkButton ID="lbn_Add" runat="server" Text="【新增采购商固定价格商品】" OnClick="lbn_Add_Click"
                                        CausesValidation="false">
                                    </asp:LinkButton>
                                    <span id="val_proScope" style="color: Red; display: none; margin-left: 20px">未选择商品，不能提交订单，请选择商品！</span>
                                </span>
                                <span style="<%=power>=2?"": "display:none" %>">
                                    <asp:Button runat="server" ID="btn_Save" Text="保　存" OnClick="btn_Save_Click" OnClientClick="return checkProductsByUpdate();" />
                                </span>
                            </div>--%>
                            <p>
                                &nbsp;</p>
                            <table width="98%" border="0" cellpadding="4" cellspacing="1" style="text-align: left">
                                <tr>
                                    <td>
                                        <h2>
                                            本期所需采购商品信息&nbsp;&nbsp;<asp:LinkButton runat="server" ID="link_Export_Detail" OnClick="link_Export_Detail_Click">[导出Excel]</asp:LinkButton>
                                        </h2>
                                        <hr />
                                    </td>
                                </tr>
                            </table>
                            <table id="tb_bfp" width="98%" border="0" cellpadding="4" cellspacing="1" bgcolor="#99BBE8"
                                style="text-align: left">
                                <tr align="center" style="height: 20px;">
                                    <td width="5%" bgcolor="#C0D5F0">
                                        序号
                                    </td>
                                    <td width="15%" bgcolor="#C0D5F0">
                                        商品名称
                                    </td>
                                    <td width="10%" bgcolor="#C0D5F0">
                                        供应商
                                    </td>
                                    <td width="10%" bgcolor="#C0D5F0">
                                        供应价
                                    </td>
                                    <td width="7%" bgcolor="#C0D5F0">
                                        出价
                                    </td>
                                </tr>
                                <asp:Repeater runat="server" ID="rpt_bfpItems">
                                    <ItemTemplate>
                                        <tr align="center" style="height: 20px;">
                                            <td bgcolor="#FFFFFF">
                                                <%# Container.ItemIndex+1%>
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# Eval("proName")%>
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# Eval("sellerName")%>
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# Eval("sellerPrice", "{0:F2}")%>
                                            </td>
                                            <td bgcolor="#FFFFFF">
                                                <%# Eval("Price", "{0:F2}")%>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </Body>
        </ext:Window>
        <ext:Window ID="win_product" runat="server" Title="选择商品" Height="630px" Width="800px"
            BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="true"
            Resizable="false" ShowOnLoad="false" Draggable="true" Icon="ApplicationViewDetail">
            <Body>
                <asp:UpdatePanel runat="server" ID="up1" UpdateMode="Conditional">
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="ddl_CategoryRoot" />
                        <asp:AsyncPostBackTrigger ControlID="ddl_CategorySub" />
                        <asp:AsyncPostBackTrigger ControlID="lbn_search" />
                    </Triggers>
                    <ContentTemplate>
                        <div class="details">
                            <table width="95%" border="0" cellpadding="4" cellspacing="1" style="text-align: left">
                                <tr>
                                    <td style="width: 20%">
                                        <label>
                                            大 类：</label>
                                        <asp:DropDownList runat="server" ID="ddl_CategoryRoot" DataTextField="name" DataValueField="categoryId"
                                            AutoPostBack="True" OnSelectedIndexChanged="ddl_CategoryRoot_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td style="width: 20%">
                                        <label>
                                            小 类：</label>
                                        <asp:DropDownList runat="server" ID="ddl_CategorySub" DataTextField="name" DataValueField="categoryId"
                                            AutoPostBack="True" OnSelectedIndexChanged="ddl_CategorySub_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                    <td style="width: 20%">
                                        商品编号:<asp:TextBox ID="txt_ProductNo" runat="server" Width="80px"></asp:TextBox>
                                    </td>
                                    <td style="width: 20%">
                                        商品名称:<asp:TextBox ID="txt_ProductName" runat="server" Width="80px"></asp:TextBox>
                                    </td>
                                    <td style="width: 15%">
                                        <asp:LinkButton ID="lbn_search" runat="server" Text="［搜索］" CausesValidation="false"
                                            OnClick="lbn_search_Click">
                                        </asp:LinkButton>
                                        <a href="javascript:resetSrhByUpdate();">［重置］</a>
                                    </td>
                                </tr>
                            </table>
                            <table id="tb_pro" width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#99BBE8"
                                style="text-align: left">
                                <tr align="center" style="height: 20px; background-color: #C0D5F0">
                                    <td width="10%">
                                        商品编号
                                    </td>
                                    <td width="20%">
                                        商品名称
                                    </td>
                                    <td width="15%">
                                        供应价(元)
                                    </td>
                                    <td width="15%">
                                        卖出价(元)
                                    </td>
                                    <td width="20%">
                                        供应商
                                    </td>
                                    <td width="10%">
                                        <input type="checkbox" name="”checkedAll”" id="checkedAll_w" />全选/取消
                                    </td>
                                </tr>
                                <asp:Repeater runat="server" ID="rpt_Products" OnItemDataBound="rpt_Products_ItemDataBound"
                                    EnableViewState="false">
                                    <ItemTemplate>
                                        <tr align="center" class='<%# Container.ItemIndex%2==0? "row-altv2":"altv2"  %>'
                                            onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='#C0D5F0'"
                                            onmouseout="this.style.backgroundColor=c">
                                            <td>
                                                <%# Eval("productNo")%>
                                            </td>
                                            <td>
                                                <a target="_blank" href="../user_productDetail_<%#Eval("productId")%>.html">
                                                    <%# Eval("Name")%></a>
                                            </td>
                                            <td>
                                                <input type="text" class="text_price_align" onblur='checkPriceByUpdate(this);' onafterpaste='checkPriceByUpdate(this);'
                                                    value="1" />/<%#Eval("unit")%>
                                            </td>
                                            <td>
                                                <input class="text_price_align" onblur='checkPriceByUpdate(this);' onafterpaste='checkPriceByUpdate (this);'
                                                    value="1" />
                                            </td>
                                            <td>
                                                <asp:DropDownList runat="server" ID="ddl" DataTextField="companyName" DataValueField="companyId"
                                                    Width="205px">
                                                </asp:DropDownList>
                                            </td>
                                            <td align="center">
                                                <input type="button" value=" 添 加 " onclick="return addTobfpItemByUpdate(this,<%#Eval("productId") %>,'<%#Eval("unit") %>');" />
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                            <div>
                                <webdiyer:AspNetPager ID="AspNetPager2" NumericButtonType="Text" MoreButtonType="Text"
                                    runat="server" AlwaysShow="False" PageSize="20" InvalidPageIndexErrorMessage="无效页码"
                                    PageIndexOutOfRangeErrorMessage="页码超出范围" ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                                    CustomInfoTextAlign="Left" HorizontalAlign="Right" OnPageChanged="AspNetPager2_PageChanged"
                                    NextPageText="下一页" FirstPageText="首页" LastPageText="末页" PrevPageText="上一页">
                                </webdiyer:AspNetPager>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </Body>
        </ext:Window>
    </div>
    </form>
    <cb:Include ID="buyerFixedList" runat="server" SetName="buyerFixedPricePeriodList" />
</body>
</html>
